import plotly as ply
import plotly.graph_objects as go
import pandas as pd
df = pd.read_csv("Stations_Coord.csv", encoding = 'latin-1')
df.head()
| Unnamed: 0 | NomeStazione | Lat | Long | Regione | |
|---|---|---|---|---|---|
| 0 | 1 | Adria | 45.04583 | 12.06087 | Veneto |
| 1 | 2 | Alta Padovana | 45.60158 | 11.90355 | Veneto |
| 2 | 3 | Aps1 | 45.39470 | 11.90932 | Veneto |
| 3 | 4 | Aps2 | 45.41468 | 11.90739 | Veneto |
| 4 | 5 | Area Feltrina | 46.03127 | 11.90675 | Veneto |
fig = go.Figure()
df_sub = df[df['Regione'] == 'Lombardia']
fig.add_trace(go.Scattergeo(
lon = df_sub['Long'],
lat = df_sub['Lat'],
text = df_sub['NomeStazione'],
marker = dict(
size=5,
color = "royalblue",
line_color='rgb(40,40,40)',
line_width=0.5,
sizemode = 'area'
),
name = 'stazioni'))
fig.update_layout(
title_text = 'Stazioni Lombardia',
showlegend = False,
geo = dict(
scope = 'europe',
landcolor = 'rgb(217, 217, 217)',
lonaxis_range = [8,12],
lataxis_range = [44,47],
)
)
fig.show()
fig = go.Figure()
df_sub = df[df['Regione'] == 'Veneto']
fig.add_trace(go.Scattergeo(
lon = df_sub['Long'],
lat = df_sub['Lat'],
text = df_sub['NomeStazione'],
marker = dict(
size=5,
color = "royalblue",
line_color='rgb(40,40,40)',
line_width=0.5,
sizemode = 'area'
),
name = 'stazioni'))
fig.update_layout(
title_text = 'Stazioni Veneto',
showlegend = False,
geo = dict(
scope = 'europe',
landcolor = 'rgb(217, 217, 217)',
lonaxis_range = [10,14],
lataxis_range = [44,47],
)
)
fig.show()
fig = go.Figure()
df_sub = df[df['Regione'] == 'Emilia-Romagna']
fig.add_trace(go.Scattergeo(
lon = df_sub['Long'],
lat = df_sub['Lat'],
text = df_sub['NomeStazione'],
marker = dict(
size=5,
color = "royalblue",
line_color='rgb(40,40,40)',
line_width=0.5,
sizemode = 'area'
),
name = 'stazioni'))
fig.update_layout(
title_text = 'Stazioni Emilia-Romagna',
showlegend = False,
geo = dict(
scope = 'europe',
landcolor = 'rgb(217, 217, 217)',
lonaxis_range = [8,13],
lataxis_range = [43,46],
)
)
fig.show()
fig = go.Figure()
df_sub = df[df['Regione'] == 'Piemonte']
fig.add_trace(go.Scattergeo(
lon = df_sub['Long'],
lat = df_sub['Lat'],
text = df_sub['NomeStazione'],
marker = dict(
size=5,
color = "royalblue",
line_color='rgb(40,40,40)',
line_width=0.5,
sizemode = 'area'
),
name = 'stazioni'))
fig.update_layout(
title_text = 'Stazioni Piemonte',
showlegend = False,
geo = dict(
scope = 'europe',
landcolor = 'rgb(217, 217, 217)',
lonaxis_range = [6,10],
lataxis_range = [43,47],
)
)
fig.show()